package com.smart.model;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.smart.util.StringUtil;

/**
 * 
 * @author Sunxin
 *
 */

@Entity 
@Table(name = "Loan") 
public class Loan extends BaseEntity<Loan>{
	private static final long serialVersionUID = 1L;
	/**
	 * 平台名
	 */
	private String name;
	
	private String url;
	
	private String iconUrl;
	
	private String coverImageUrl;
	
	private String shortDescription;
	
	private String description;
	/**
	 * 目标人群
	 */
	private String targetGroup;
	/**
	 * 申请笔数
	 */
	private String totalApplyCount;
	/**
	 * 成功率
	 */
	private String successRate;
	/**
	 * 日利率-->月利息,不改改字段了
	 */
	private String dailyInterestRate;
	/**
	 * 平均额度
	 */
	private Integer averageqQuota;
	/**
	 * 额度单位
	 */
	private String quotaUnit;

	/**
	 * 平均申请耗时
	 */
	private Integer averageApplyTime;
	/**
	 * 耗时单位
	 */
	private String applyTimeUnit;
	/**
	 * 特点
	 */
	private String tags;
	
	@Transient
	private List<String> tagsList;
	
	private String interestRate7;
	
	private String interestRate15;
	
	private String interestRate30;
	
	private String interestRate90;
	
	private String interestRate180;
	
	
	public String getInterestRate7() {
		return interestRate7;
	}

	public void setInterestRate7(String interestRate7) {
		this.interestRate7 = interestRate7;
	}

	public String getInterestRate15() {
		return interestRate15;
	}

	public void setInterestRate15(String interestRate15) {
		this.interestRate15 = interestRate15;
	}

	public String getInterestRate30() {
		return interestRate30;
	}

	public void setInterestRate30(String interestRate30) {
		this.interestRate30 = interestRate30;
	}

	public String getInterestRate90() {
		return interestRate90;
	}

	public void setInterestRate90(String interestRate90) {
		this.interestRate90 = interestRate90;
	}

	public String getInterestRate180() {
		return interestRate180;
	}

	public void setInterestRate180(String interestRate180) {
		this.interestRate180 = interestRate180;
	}
	/**
	 * 是否快速到账
	 */
	private boolean fast;
	/**
	 * 是否最热
	 */
	private boolean hot;
	/**
	 * 是否最新
	 */
	private boolean latest;
	/**
	 * 是否推荐
	 */
	private boolean recommend;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getIconUrl() {
		return iconUrl;
	}

	public void setIconUrl(String iconUrl) {
		this.iconUrl = iconUrl;
	}

	public String getCoverImageUrl() {
		return coverImageUrl;
	}

	public void setCoverImageUrl(String coverImageUrl) {
		this.coverImageUrl = coverImageUrl;
	}

	public String getShortDescription() {
		return shortDescription;
	}

	public void setShortDescription(String shortDescription) {
		this.shortDescription = shortDescription;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public boolean isFast() {
		return fast;
	}

	public void setFast(boolean fast) {
		this.fast = fast;
	}

	public boolean isHot() {
		return hot;
	}

	public void setHot(boolean hot) {
		this.hot = hot;
	}

	public boolean isLatest() {
		return latest;
	}

	public void setLatest(boolean latest) {
		this.latest = latest;
	}

	public String getTargetGroup() {
		return targetGroup;
	}

	public void setTargetGroup(String targetGroup) {
		this.targetGroup = targetGroup;
	}

	public String getTotalApplyCount() {
		return totalApplyCount;
	}

	public void setTotalApplyCount(String totalApplyCount) {
		this.totalApplyCount = totalApplyCount;
	}

	public String getSuccessRate() {
		return successRate;
	}

	public void setSuccessRate(String successRate) {
		this.successRate = successRate;
	}

	public String getDailyInterestRate() {
		return dailyInterestRate;
	}

	public void setDailyInterestRate(String dailyInterestRate) {
		this.dailyInterestRate = dailyInterestRate;
	}

	

	public Integer getAverageqQuota() {
		return averageqQuota;
	}

	public void setAverageqQuota(Integer averageqQuota) {
		this.averageqQuota = averageqQuota;
	}

	public String getQuotaUnit() {
		return quotaUnit;
	}

	public void setQuotaUnit(String quotaUnit) {
		this.quotaUnit = quotaUnit;
	}

	public Integer getAverageApplyTime() {
		return averageApplyTime;
	}

	public void setAverageApplyTime(Integer averageApplyTime) {
		this.averageApplyTime = averageApplyTime;
	}

	public String getApplyTimeUnit() {
		return applyTimeUnit;
	}

	public void setApplyTimeUnit(String applyTimeUnit) {
		this.applyTimeUnit = applyTimeUnit;
	}

	public boolean isRecommend() {
		return recommend;
	}

	public void setRecommend(boolean recommend) {
		this.recommend = recommend;
	}

	public String getTags() {
		return tags;
	}

	public void setTags(String tags) {
		this.tags = tags;
	}

	public List<String> getTagsList() {
		List<String> list = new ArrayList<>();
		if(StringUtil.isNotEmpty(this.tags)) {
			String [] tags =this.tags.split(",");
			Collections.addAll(list, tags);
		}
		return list;
	}
	public void setTagsList(List<String> tagsList) {
		this.tagsList = tagsList;
	}
	
}
